package com.bskj.kuaifu.service;

import java.util.Map;

import org.springframework.transaction.annotation.Transactional;

import com.bskj.common.bean.model.UserInfo;
import com.bskj.common.bean.model.UserThirdAuth;
import com.bskj.common.enums.ThirdPlatformTypeEnum;
import com.bskj.common.service.IBaseService;

public interface IUserThirdAuthService extends IBaseService<UserThirdAuth> {
	/**
	 * 获取微信平台（公众号和小程序）关联的用户
	 * 
	 * @param appid 
	 * @param openid
	 * @return
	 * @throws Exception
	 */
	UserInfo getUserInfoWithWeInfo(String appid, String openid, ThirdPlatformTypeEnum thirdPlatformType)
			throws Exception;

	/**
	 * 获取用户第三方授权（小程序）信息
	 * 
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	
	UserThirdAuth getUserThirdAuth(Integer userId, String appid) throws Exception;
	
	/**
	 * 保存用户小程序相关信息
	 * 
	 * @return
	 * @throws Exception
	 */
	@Transactional(rollbackFor = Exception.class)
	Map<String,Object> saveThirdAuth(String appid,String openid,String unionid,ThirdPlatformTypeEnum type)throws Exception;
}
